package com.loong.common.enumerate;

import lombok.Getter;

/**
 * @Description:
 * @Author: hzp
 * @Date: 2020-11-3 14:35
 */
@Getter
public enum ConfigType {
    Seller("1","seller","商家"),
    Shop("2","shop","商品"),
    Picture("3","picture","图片"),
    Picture_Seller("4","picture_seller","图片+商家"),
    Picture_Shop("5","picture_shop","图片+商品"),
    UnKnown("6", "unknown", "未知"),;

    private String code;
    private String name;
    private String desc;
    ConfigType(String code,String name, String desc) {
        this.name = name;
        this.desc = desc;
        this.code=code;
    }

    public static ConfigType getConfigType(String code) {
        ConfigType configTypeEnum;
        switch (code) {
            case "1":
                configTypeEnum = ConfigType.Seller;
                break;
            case "2":
                configTypeEnum = ConfigType.Shop;
                break;
            case "3":
                configTypeEnum = ConfigType.Picture;
                break;
            case "4":
                configTypeEnum = ConfigType.Picture_Seller;
                break;
            default:
                configTypeEnum = ConfigType.UnKnown;
                break;
        }
        return configTypeEnum;
    }


}
